#!/usr/bin/env node

//console.log(`PID: ${process.pid}`)

////流的方式是每隔两秒就能拿到，缓存的话要等16秒

//setInterval(() => {
  //console.log(Date.now())
//} ,2000)

//setTimeout(() => {
  //process.exit()
//}, 16000)


console.log('I am child process. PID:', process.pid);

const timer = setInterval(() => {
    console.log('time:', Date.now());
}, 2000);

setTimeout(() => {
    clearInterval(timer);
    console.log('OK! 16 seconds. Game Over!');
}, 16000);

